Finding the period of trigonometric equation